
{ config, pkgs, ... }:

{
  programs.hyprland.enable = true;
  imports = [ ( import ./waybar.nix ) ];
  services.xserver.displayManager.gdm = {
    enable = true;
    wayland = true;
  };
  services.gnome.gnome-keyring.enable = true;
  programs.xwayland.enable = true;

  # xdg.portal = {
  #   enable = true;
  #   # wlr.enable = true;
  # };
# programs = {
#     ncmpcpp = {
#       enable = true;
#       mpdMusicDir = null;
#     };
#   };
  services = {
    mpd = {
      enable = true;
      # musicDirectory = ~/Music;
      extraConfig = ''
        audio_output {
                type            "pipewire"
                name            "PipeWire Sound Server"
        }
      '';
    };
  };
  # * setting these variables repeatedly (in gnome and here) results in the bug of fcitx5
  # environment.sessionVariables = {
  #   # WLR_NO_HARDWARE_CURSORS = "1";
  #   QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
  #   NIXOS_OZONE_WL = "1";
  #   MOZ_ENABLE_WAYLAND = "1";
  #   _JAVA_AWT_WM_NONREPARENTING = "1";
  #   XDG_SESSION_TYPE = "wayland";
  #   SDL_VIDEODRIVER = "wayland";
  #   QT_QPA_PLATFORM = "wayland";

  #   # QT_QPA_PLATFORMTHEME = "gtk3";
  #   # QT_SCALE_FACTOR = "1";
  #   # QT_AUTO_SCREEN_SCALE_FACTOR = "1";
  #   # WLR_NO_HARDWARE_CURSORS = "1"; # if no cursor,uncomment this line
  #   # WLR_RENDERER_ALLOW_SOFTWARE = "1";
  #   # XDG_CURRENT_DESKTOP = "Hyprland";
  #   # XDG_SESSION_DESKTOP = "Hyprland";

  #   # CLUTTER_BACKEND = "wayland";
  #   # WLR_RENDERER = "vulkan";
  #   # GTK_USE_PORTAL = "1";
  #   # NIXOS_XDG_OPEN_USE_PORTAL = "1";
  # };

  programs.dconf.enable = true;

  environment.systemPackages = (with pkgs; [
    mako
    hyprpaper
    libsForQt5.dolphin
    wlogout
    light
    qt5.qtwayland
    qt6.qmake
    qt6.qtwayland
    adwaita-qt
    adwaita-qt6
    xdg-utils
    rofi-wayland
    xwayland
    wayland-utils
    pamixer
    mpd
# wineWowPackages.waylandFull
wineWowPackages.stableFull
wineWowPackages.fonts
winetricks
  ]);


}

